/*
	File:				ObjectManager.h
	Course:		SGP 1208
	Author:		Kori Po
	Purpose:	Manages all in game objects
*/

#pragma once

#include "IEntity.h"
#include <vector>



class CObjectManager
{
public:
	// SINGLETON!
	static CObjectManager* GetInstance( void );
	static void DeleteInstance( void );

	void AddObject( IEntity* ptr );
	void RemoveObject( IEntity* ptr );
	void RemoveAllObjects( void );

	void UpdateAllObjects( float fElapsedTime );
	void CheckCollisions( void );
	void RenderAllObjects( void );

	void Switcharoo( IEntity* ptrA,  IEntity* ptrB );
	//bool Think( IEntity* ptrA,  IEntity* ptrB );

private:
	// SINGLETON!
	static CObjectManager* s_Instance;

	CObjectManager( void );
	~CObjectManager( void );

	CObjectManager( const CObjectManager& );
	CObjectManager& operator=( const CObjectManager& );


	// 'Easy' names for the container
	typedef std::vector< IEntity* >		PlayerList;
	typedef PlayerList::iterator		PListIterator;

	PlayerList		m_vPlayers;
	bool				m_bPlayersIterating;

	// Enemies
	typedef std::vector< IEntity* >		EnemyList;
	typedef EnemyList::iterator		EListIterator;

	EnemyList		m_vEnemies;
	bool				m_bEnemiesIterating;

	 //Items
	typedef std::vector< IEntity* >		ItemsList;
	typedef ItemsList::iterator		IListIterator;
	
	ItemsList		m_vItems;
	bool				m_bItemsIterating;

	 //Ability
	typedef std::vector< IEntity* >		AbilitiesList;
	typedef AbilitiesList::iterator		AListIterator;
	
	AbilitiesList		m_vAbilities;
	bool				m_bAbilitiesIterating;

	 //Layers
	typedef std::vector< IEntity* >		LayersList;
	typedef LayersList::iterator		LListIterator;
	
	LayersList		m_vLayers;
	bool				m_bLayersIterating;

	 //Mega Render List
	typedef std::vector< IEntity* >		MegaList;
	typedef MegaList::iterator		MListIterator;
	
	MegaList		m_vMega;
	bool				m_bMegaIterating;
};

